﻿@using TinyMoocSite.ViewModels
@model CourseBasicInfoForm

@{
    ViewBag.Title = "更新课程";
    Layout = "~/Views/Administrator/FeatureLayout.cshtml";
}

@section CourseManage { active }
@section AccountManage {  }

@section RightContainer
{
    <h4>课程管理&raquo;修改课程信息</h4><hr />
    <div class="form-bottom">        
        <div class="col-sm-9 text-center">
            <form role="form" action="/Administrator/DoUpdateCourse" method="post" class="register-form">
                <div class="form-group">
                    <label for="form-course-id" class="col-sm-2 control-label">课程编号</label>
                    <div class="col-sm-10">
                        <input type="text" name="CourseId" class="form-control"
                               id="form-course-id" value="@Model.CourseId" readonly>
                    </div>
                </div>
                <br /><br />
                <div class="form-group">
                    <label for="form-course-title" class="col-sm-2 control-label">课程名称</label>
                    <div class="col-sm-10">
                        <input type="text" name="CourseTitle" class="form-control" 
                               id="form-course-title" value="@Model.CourseTitle" readonly>
                    </div>
                </div>
                <br /><br />

                <div class="form-group">
                    <label for="form-start-time" class="col-sm-2 control-label">起止时间</label>
                    <div class="col-sm-1">从</div>
                    <div class="col-sm-4">
                        <input type="date" name="StartTime" class="form-control"
                               value="@Model.StartTime.ToString("yyyy-MM-dd")" id="form-start-time">
                    </div>
                    <div class="col-sm-1">至</div>
                    <div class="col-sm-4">
                        <input type="date" name="EndTime" class="form-control"
                               value="@Model.EndTime.ToString("yyyy-MM-dd")"  id="form-end-time">
                    </div>
                </div>
                <br /><br /><br />

                <div class="form-group">
                    <label for="form-teachers" class="col-sm-2 control-label">选定教师</label>
                    <div class="col-sm-10">
                        @foreach (TeacherSelection item in Model.TeacherList)
                        {
                            var ischecked = "";
                            if (item.Selected)
                            {
                                ischecked = "checked='checked'";
                            }

                            <p class="left"><input type="checkbox" name="TeacherList" value="@item.FullName" @ischecked>@item.FullName</p>
                        }
                    </div>
                </div>

                <div class="text-center">
                    <button type="submit" class="btn btn-default">更新课程数据</button>
                    &nbsp;&nbsp;
                    <button type="button" class="btn btn-default" onclick="history.back();">返回课程管理</button>
                </div>

                <br /><br />
            </form>
        </div>
    </div>
}
